package com.ql.service.keshi.impl;
import com.ql.dao.user.KeshiMapper;
import com.ql.pojo.user.Keshi;
import com.ql.pojo.user.Role;
import com.ql.service.keshi.KeShiService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;


@Service("keShiService")
public class KeShiServiceImpl implements KeShiService {
    private static final Logger LOGGER = Logger.getLogger(KeShiServiceImpl.class);
    @Resource
    KeshiMapper keshiMapper;
    @Override
    public List<Keshi> getAllKeShi() {
        List<Keshi> keshiList = new ArrayList<>();

        try {
            keshiList = keshiMapper.getAllKeiShi();
            if (keshiList.size()<=0){
                LOGGER.debug("KeShiServiceImpl.getAllKeShi 查询为空！");
            }else {
                LOGGER.debug("KeShiServiceImpl.getAllKeShi 查询成功！");
            }
        } catch (Exception e) {
            LOGGER.debug("KeShiServiceImpl.getAllKeShi 查询异常！》》》"+e.getMessage());
        }
        return keshiList;
    }

    @Override
    public List<Keshi> findKeShi() {
        List<Keshi> keshis = keshiMapper.selectByExample(null);
        return  keshis;
    }

}

